1. Field of the Invention
The present invention relates to an apparatus a program, and a method for image tone transformation, and an electronic camera.
2. Description of the Related Art
(Prior Art 1)
Japanese Unexamined Patent Application Publication No. Hei 4-150171 (hereinafter, referred to as Patent document 1) describes a conventional tone transformation technique.
According to this prior art, a luminance signal Y is calculated by the following equation:Y=0.3·R+0.59·G+0.11·B  [1]
Next, predetermined tone transformation Y′=f(Y) is applied to the luminance signal Y to find a luminance signal Y′ after the transformation. This tone transformation uses a gamma transformation characteristic f(Y)=YΛγ, an arbitrary nonlinear function, or the like. A ratio of the luminance signals before and after the transformation is calculated as a transformation gain k(Y).
Each of RGB color components of an image is multiplied by the transformation gain k(Y), to calculate the following equation and find by color components R′, G′, B′ after the transformation.R′=k(Y)·R G′=k(Y)·G B′=k(Y)·B  [2]
The prior art in Patent document 1 is suitable for adjusting the general brightness/darkness balance of the whole image. However, this prior art cannot realize image processing such as particularly emphasizing the tone of a detailed portion so as to attain an image with a higher contrast and a more detailed expression.
(Prior Art 2)
Another known tone correction method is a Retinex method. The Retinex method can emphasize a minute variance in the tone to retrieve the tone hidden in a dark portion or the like.
With the Retinex method, it has been difficult to perform delicate processing such as adjusting the rise of the tone of a detailed portion while adjusting the general brightness/darkness balance of the whole image.
(Prior Art 3)
Japanese Unexamined Patent Application Publication No. 2003-008935 (hereinafter, referred to as Patent document 2) discloses a method of compressing a dynamic range by the following equation.O[i, j]=I[i, j]×F(R[i, j])  [100],whereI[i, j] is a pixel value of an input image, O[i, j] is a pixel value of an output image, F( ) is a coefficient calculation function, and R[i, j] is a pixel value of the input image after it goes through an Epsilon filter. The Epsilon filter is a nonlinear filter for nonlinearly extracting a small amplitude component from the input image to subtract the small amplitude component from the input image.
However, the processing as expressed by the equation [100] has sometimes resulted in excessively exaggerating shadows. There has been a problem that, when an image including a person is subjected to the strong gamma correction, the exaggeration of shadows increases, which causes unnatural finish of the image of the person and a conspicuous unnatural impression, compared with a case where linear image processing is applied to brightness of a subject.
The processing with the Epsilon filter has another problem that it is complicated and takes a lot of time. On the other hand, the use of a simple low pass filter instead of the Epsilon filter has a problem of causing a halo in a portion having a great luminance difference.
Moreover, the aforesaid Patent document 2 discloses a case where the input image has only 1 component, that is, I[i, j]. In this case it is difficult to obtain a favorable result for respective color components of an image such as a color image having a plurality of components even if the processing as expressed by the following equations is applied thereto.O1[i, j]=I1[i, j]×F(R1[i, j])  [101]O2[i, j]=I2[i, j]×F(R2[i, j])  [102]O3[i, j]=I3[i, j]×F(R3[i, j])  [103]